package com.wen.center.user.controller;

import com.wen.center.user.dao.UserInfoDao;
import com.wen.center.user.domain.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by LAIO on 2018/5/27.
 */
@RestController
@RequestMapping("/test")
public class DemoController {

    @Autowired
    private UserInfoDao userDao;

    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public Map<String, String> helloWorld() {
        Map<String, String> map = new HashMap<>();
        map.put("hello", "world");
        return map;
    }
    @RequestMapping(value = "/all", method = RequestMethod.GET)
    public List<UserInfo> all() {
        List<UserInfo> result = userDao.findAll();
        return result;
    }

}
